<template>
  <div>
    <!-- 轮播图 -->
    <Banner :bannerList="bannerList" />
    <NewGoodList :NewGoodList="NewGoodList" />
  </div>
</template>

<script>
import Banner from './banner.vue';
import NewGoodList from './GoodList.vue';
export default {
  data() {
    return {
      bannerList: [],
      NewGoodList: [],
    };
  },
  mounted() {
    this.$http.get('/koding/index/index').then((ret) => {
      // 只要errno为0就代表请求成功
      if (ret.errno === 0) {
        // 将brandList存到bannerList中
        this.bannerList = ret.data.banner;
        this.NewGoodList = ret.data.newGoodsList;
      }
    });
  },
  components: {
    Banner,
    NewGoodList,
  },
};
</script>

<style></style>
